package com.swt.service.T_service.impl;

import com.swt.dao.Tdao.StaffDao;
import com.swt.domain.Staff;
import com.swt.service.T_service.StaffService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service(value = "TTStaffServiceImp")
@Transactional
public class StaffServiceImp implements StaffService {
    @Resource(name = "TTStaffDaoImpl")
    private StaffDao staffDao;

    @Override
    public boolean staffAdd(String staffname, String staffphone, String staffsex, String staffrole, String staffsupport, String staffimg, int shopid,int clubClubId) {
        return staffDao.staffAdd(staffname,staffphone,staffsex,staffrole,staffsupport,staffimg,shopid, clubClubId);
    }

    @Override
    public List<Staff> staffQuery(int page,String query,int clubClubId) {

        List<Staff> staffList = staffDao.staffQuery(page,query,clubClubId);
        return staffList;
    }
//员工删除
    @Override
    public boolean staffDelete(int id) {
        return staffDao.staffDelete(id);
    }

    @Override
    public List<Staff> staffQuery2(int id) {
        return staffDao.staffQuery2(id);
    }

    @Override
    public boolean staffUpdate(int staffid,String staffname, String staffphone, String staffsex, String staffrole, String staffsupport, String staffimg, int shopid) {
        boolean aBoolean = staffDao.staffUpdate(staffid,staffname,staffphone,staffsex,staffrole,staffsupport,staffimg,shopid);
        return aBoolean;
    }

    @Override
    public List<Staff> queryStaffPK(int clubClubId) {
        return staffDao.queryStaffPK( clubClubId);
    }

    public StaffDao getStaffDao() {
        return staffDao;
    }

    public void setStaffDao(StaffDao staffDao) {
        this.staffDao = staffDao;
    }
}
